import Main from '../views/Main.vue'
import admin from './admin'

export default [
  {
    path: '/',
    name: 'main',
    component: Main,
    children: [
      {
        path: '/home',
        name: 'home',
        meta: {
          title: '首页'
        },
        component: () => import('@/views/Home.vue'),
      },
      {
        path: '/vip',
        name: 'vip',
        meta: {
          title: '超级会员'
        },
        component: () => import('../views/vip/Index.vue')
      },
      {
        path: 'my',
        name: 'my',
        meta: {
          title: '个人中心'
        },
        component: () => import('@/views/My.vue'),
      }
    ]
  },
// 不作为Main组件的子页面展示的页面单独写，如下
  {
    path: '/login',
    name: 'login',
    meta: {
      title: 'Login - 登录'
    },
    component: () => import('@/views/Login.vue')
  },
  {
    path: '/goodsdetail/:id',
    name: 'goodsdetail',
    meta: {
      title: '商品详情'
    },
    component: () => import('../views/goods/GoodsDetail.vue')
  },
  {
    path: '/goods-comment/:goods_id',
    name: 'goods-comment',
    meta: {
      title: '商品评价'
    },
    component: () => import('../views/goods/Comment.vue')
  },
  {
    path: '/goods-complain/:goods_id',
    name: 'goods-complain',
    meta: {
      title: '投诉'
    },
    component: () => import('../views/goods/Complain.vue')
  },
  {
    path: '/suggest',
    name: 'suggest',
    meta: {
      title: '建议'
    },
    component: () => import('../views/other/Suggest.vue')
  },
  {
    path: '/submit/:id/:skuid/:invid?/:kanjia_order_id?',
    name: 'submit',
    meta: {
      title: '确认订单'
    },
    component: () => import('../views/goods/Submit.vue')
  },
  {
    path: '/pay/:order_id',
    name: 'pay',
    meta: {
      title: '支付'
    },
    component: () => import( '../views/pay/Pay.vue')
  },
  {
    path: '/pay_result/:order_id',
    name: 'pay-result',
    meta: {
      title: '支付结果'
    },
    component: () => import( '../views/pay/PayResult.vue')
  },
  {
    path: '/vip-pay-result/:order_id',
    name: 'vip-pay-result',
    meta: {
      title: '支付结果'
    },
    component: () => import('../views/vip/PayResult.vue')
  },
  {
    path: '/order',
    name: 'order',
    meta: {
      title: '订单'
    },
    component: () => import('../views/order/Order.vue'),
    children: [
      {
        path: '/order/detail/:order_id',
        name: 'order-detail',
        meta: {
          title: '订单详情'
        },
        component: () => import('../views/order/OrderDetail.vue'),
      },
      {
        path: '/order/list/:type',
        name: 'order-list',
        meta: {
          title: '订单列表'
        },
        component: () => import('../views/order/OrderList.vue')
      },
      {
        path: '/kj_order/list/:type',
        name: 'kj-order-list',
        meta: {
          title: '砍价订单列表'
        },
        component: () => import('../views/order/KanJiaOrderList.vue')
      },
      {
        path: '/kj_order/detail/:order_id',
        name: 'kj-order-detail',
        meta: {
          title: '砍价订单详情'
        },
        component: () => import('../views/order/KanJiaOrderDetail.vue')
      },
      {
        path: '/order/code/:order_id',
        name: 'order-code',
        meta: {
          title: '核销'
        },
        component: () => import('../views/order/Code.vue')
      },
      {
        path: '/order/refund/:order_id',
        name: 'order-refund',
        meta: {
          title: '退款'
        },
        component: () => import('../views/order/Refund.vue')
      },
      {
        path: '/order/Comment/:order_id',
        name: 'order-comment',
        meta: {
          title: '评价'
        },
        component: () => import('../views/order/Comment.vue')
      }
    ]
  },
  {
    path: '/spread',
    name: 'distribution',
    meta: {
      title: '推广'
    },
    component: () => import('../views/spread/Main.vue'),
    children: [
      {
        path: '/spread/mydistribution',
        name: 'mydistribution',
        meta: {
          title: '我的邀请'
        },
        component: () => import('../views/spread/Distribution.vue')
      },{
        path: '/spread/myreward',
        name: 'myreward',
        meta: {
          title: '我的推广'
        },
        component: () => import('../views/spread/Reward.vue')
      },{
        path: '/spread/rank',
        name: 'reward-rank',
        meta: {
          title: '排行榜'
        },
        component: () => import('../views/spread/Rank.vue')
      }
    ]
  },
  {
    path: '/wallet',
    name: 'wallet',
    meta: {
      title: '钱包'
    },
    component: () => import('../views/wallet/main.vue'),
    children: [{
      path: '/wallet/withdrawals',
      name: 'withdrawals',
      meta: {
        title: '提现'
      },
      component: () => import('../views/wallet/Withdrawals.vue')
    },{
      path: '/wallet/withdrawals-record',
      name: 'withdrawals-record',
      meta: {
        title: '提现记录'
      },
      component: () => import('../views/wallet/WithdrawalsRecord.vue')
    }]
  },
  {
    path: '/subject/:sub_id',
    name: 'subject',
    meta: {
      title: '专题'
    },
    component: () => import('../views/subject/SubjectDetail.vue')
  },
  {
    path: '/category-list/:category_id?',
    name: 'category-list',
    meta: {
      title: '分类'
    },
    component: () => import('../views/category/CategoryList.vue')
  },
  admin
];